/*******************************************************************************
 * Package: com.chris.order.api
 * Type:    ProductFegin
 * Date:    2024/3/1 下午6:43
 *
 * Copyright (c) 2024 BOING CORP.,LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.chris.order.api;

import com.chris.common.entity.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * TODO your comment
 *
 * @author Hudesheng
 * @date 2024/3/1 下午6:43
 */
@FeignClient(value = "service-product",fallbackFactory = ProductFeginFallBackFactory.class
        //fallback = ProductFeginFallCallBack.class
)
public interface ProductFegin {
    //指定调用提供者的哪个方法
    //@FeignClient+@GetMapping 就是一个完整的请求路径 http://service- product/product/{pid}
    @GetMapping(value = "/product/{pid}")
    Product findByPid(@PathVariable("pid") Integer pid);
}